//Granify Android SDK/com.granifyinc.granifysdk/Granify
Granify
[androidJvm]
object Granify
The entry point for all Granify SDK API methods.
Functions
Name | Summary |
---|---|
activateGranify | [androidJvm] @JvmStatic fun activateGranify(configuration: GranifyConfiguration) Activates the Granify SDK and initiates communication with Granify’s servers. |
clearShopperId | [androidJvm] @JvmStatic fun clearShopperId() Clears the current shopper identifier. |
overrideGranifyInlineView | [androidJvm] @JvmStatic fun overrideGranifyInlineView(label: String?) Specifies a GranifyInlineView location in which to display inline widgets for testing purposes. |
registerGroupAssignmentProvider | [androidJvm] @JvmStatic fun registerGroupAssignmentProvider(provider: () -> MatchingGroup) Register a callback provider for specifying group assignments when a new session is created. |
setChildSiteId | [androidJvm] @JvmStatic fun setChildSiteId(childSiteId: SiteIdentifier?) Notifies Granify that the child site has changed. |
setCurrentProduct | [androidJvm] @JvmStatic fun setCurrentProduct(sku: String, productId: String) Notifies Granify which specific product on a product page is currently selected. |
setRestrictionState | [androidJvm] @JvmStatic fun setRestrictionState(restrictionState: RestrictionState) Tells Granify to enter/exit a restricted state in which no campaign can be shown to the shopper. Note that this does not apply to inline campaigns, which will not be hidden while in a restricted state. |
setShopperId | [androidJvm] @JvmStatic fun setShopperId(shopperId: String) Notifies Granify of the current customer’s unique identifier. |
showCampaign | [androidJvm] @JvmStatic fun showCampaign(campaignId: String) Requests that Granify show the specified campaign (or message) within this session. |
subscribeErrorReporting | [androidJvm] @JvmStatic fun subscribeErrorReporting(handler: (ErrorType, String) -> Unit) Registers a callback handler to be notified when the Granify SDK has encountered an error it cannot resolve internally. |
subscribeGroupAssigned | [androidJvm] @JvmStatic fun subscribeGroupAssigned(handler: (MatchingGroup) -> Unit) Registers a callback handler to be notified when a matching group has been assigned. |
subscribeMessageShown | [androidJvm] @JvmStatic fun subscribeMessageShown(handler: (DisplayStatus) -> Unit) Registers a callback handler to be notified when a message is (or could have been) shown. |
trackCart | [androidJvm] @JvmStatic fun trackCart(items: Map<Product, Int>) Notifies Granify of the contents of the shopper’s cart. |
trackOrder | [androidJvm] @JvmStatic fun trackOrder(details: Order) Notifies Granify about completed purchases. |
trackPageView | [androidJvm] @JvmStatic fun @JvmOverloads @JvmStatic fun trackPageView(pageIdentifier: PageIdentifier, activity: FragmentActivity, navigator: Navigator, safeArea: () -> SliderMargins?? = null, scrollableView: ScrollableView? = null, pageRestrictionState: RestrictionState = RestrictionState.UNRESTRICTED) Tracks any changes to the active "page" or view that is displayed to the user in the application. |
trackProduct | [androidJvm] @JvmStatic fun trackProduct(products: List<Product>, carter: Carter) Notifies Granify about the products available on a product page. |
trackWishList | [androidJvm] @JvmStatic fun trackWishList(name: String, contents: List<WishListItem>) Notifies Granify of the contents of the shopper’s wish list. |